
---@class GOAPTreeNode
---@field ID number
---@field parentNode GOAPTreeNode
---@field actionHandler ActionHandlerBase
---@field currentState State
---@field goalState State
---@field cost number
GOAPTreeNode = class()

GOAPTreeNode.id = 0;
GOAPTreeNode.DEFAULT_ID = 0;
function GOAPTreeNode.ResetID()
    GOAPTreeNode.id = GOAPTreeNode.DEFAULT_ID;
end

---@field handler GOAPActionHandlerBase
function GOAPTreeNode:ctor(handler)
    self.ID = GOAPTreeNode.id;
    GOAPTreeNode.id = GOAPTreeNode.id + 1;
    self.actionHandler = handler;
    self.cost = 0;
    self.parentNode = nil;
    self.currentState = State.new();
    self.goalState = State.new();
end

---@param otherNode GOAPTreeNode
function GOAPTreeNode:CopyState(otherNode)
    self.currentState:Copy(otherNode.currentState);
    self.goalState:Copy(otherNode.goalState);
end

